Skip to content

fix(install): pre-flight SSH github.com marketplace plugins over SSH - #3200

Merged
Daniel Meppiel (danielmeppiel) merged 12 commits into
microsoft:mainfrom
MohammedAlkindi:fix/ssh-github-marketplace-preflight
Oct 16, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 12 commits into
microsoft:mainfrom
MohammedAlkindi:fix/ssh-github-marketplace-preflight

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor

Description

An in-repo plugin from a github.com marketplace registered over SSH resolves with explicit_scheme="ssh", but _validate_package_exists sent it to the HTTPS-only downloader probes, so an SSH-key-only private marketplace failed pre-flight. It now takes the git ls-remote clone-root probe from #2063. HTTPS registrations are unchanged.

before: Expected '_validate_virtual_package' to not have been called. (4 failed, 1 passed)
after:  5 passed

Issue and approved scope

Issue: #3164

Human scope-approval comment: #3164 (comment)

Remaining: a CLI install against a real SSH-only private marketplace.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass (Windows symlink-privilege failures, same without the fix)
  • Added tests for new functionality (if applicable)

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml updated
  • Test edit: a @pytest.mark.req("req-XXX") test under tests/spec_conformance/
  • CONFORMANCE.{md,json} regenerated via gen_statement
  • N/A -- this PR does not change OpenAPM-observable behaviour.

An in-repository plugin from a github.com marketplace registered over
SSH resolves to a virtual subdirectory reference with
explicit_scheme == "ssh", but validation sent every GitHub-host virtual
package to the HTTPS-only downloader probes. With only an SSH key, a
private marketplace failed the pre-flight even though the download
step uses SSH.

Route such references to the git ls-remote clone-root probe that
non-GitHub hosts use since microsoft#2063, so strict SSH mode makes no HTTPS
probe. HTTPS registrations keep the downloader probes.

Fixes microsoft#3164

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Transport ownership, inaccurate SSH failure diagnostics, stale auth guidance, and missing type annotations remain unresolved.

4 open findings
What changed in this PR

Fixes SSH-only pre-flight validation for in-repository plugins from SSH-registered GitHub marketplaces.

Changes:

  • Routes explicit SSH GitHub subdirectories through git ls-remote.
  • Adds SSH/HTTPS regression coverage.
  • Updates marketplace documentation and changelog.
File Description
src/​apm_cli/​install/​validation.py Adds SSH-aware validation routing.
tests/​unit/​install/​test_validation_github_ssh_subdir.py Tests SSH-only and unchanged HTTPS behavior.
docs/​src/​content/​docs/​consumer/​installing-from-marketplaces.md Documents GitHub SSH marketplace support.
CHANGELOG.md Records the fix.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/apm_cli/install/validation.py Outdated
Comment thread src/apm_cli/install/validation.py Outdated
Comment thread docs/src/content/docs/consumer/installing-from-marketplaces.md
Comment thread tests/unit/install/test_validation_github_ssh_subdir.py Outdated
Decide the clone-root probe with initial_transport_scheme() instead of
re-reading explicit_scheme, and guard that consumer in the
marketplace-package-remote architecture rule.

When the clone-root probe ran, stop reporting the four-probe chain; an
SSH failure now names the SSH key. Update both authentication pages and
type the new test helpers.
Preserve current upstream fixes before validating the SSH marketplace route.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
@danielmeppiel

Daniel Meppiel (danielmeppiel) commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_now

SSH marketplace install fidelity: identical production diff on main-integrated head, CI-repair spec annotation with 8 mutation traps, four specialist personas across two delta waves return zero findings.

panel-mode=delta; personas=test-coverage-expert,apm-ceo

cc Mohammed Alkindi (@MohammedAlkindi) Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

Mechanical integration: The existing ship_now assessment carries to d3d0679ae95ebbf3262f9f7c3d67ca588c470d50 after faithful integration of main ee08bb59b9a7bce67fb4010e4af8652c4c53a7de. No new panel was run. The reviewed source/test/owner patch is unchanged, every reviewed regression-test file is byte-identical, and no semantic conflict resolution was needed. Current exact-head validation is recorded below; the original panel synthesis follows for provenance.

This fourth delta synthesis covers the narrow CI-repair scope after main integration. The production diff between the prior reviewed head (42fc40a on 9fb5ce8) and the previously published candidate (facd594 on 2a8213a) is byte-identical (SHA-256 059cb6ce...b79b), confirmed by production-review-equivalence.json. All prior auth, performance, supply-chain-security, and test-coverage findings from the three preceding panels remain valid without rerun because the production delta has not changed. The only new work since the prior ship_now synthesis is the spec-conformance CI repair: SpecConformance ModeB flagged source critical-path additions lacking req-linked evidence. Rather than waive or weaken the gate, four new test cases were added to tests/spec_conformance/test_lockfile_reqs.py, annotating the already-reviewed real-Git SSH bare-cache fixture under req-lk-003 -- proving repository identity and exact resolved commit are persisted in the lockfile. No new production code, no gate bypass. CONFORMANCE.json and CONFORMANCE.md were regenerated. The latest delta roster (test-coverage-expert) returned zero findings and confirmed the annotation is genuine, not a stub.

The hermetic integration fixture exercises real Git transport through native git upload-pack served via an SSH command seam against a local bare repository. This is not a live private-GitHub smoke test. It is a sound, reproducible boundary for the transport-fidelity and credential-isolation promises this PR makes. Live-endpoint coverage remains a future hardening opportunity, not a gap in this change.

At the original panel, verification of then-published head facd594 was: 402 tests passed in 158.41s, full conformance suite 313 pass 2 skip in 94.76s, all canonical lint and architecture boundary gates pass, eight mutation traps across bare-cache ref verification, scrub ordering, SSH preflight, and explicit-caller paths prove the guards are load-bearing. At panel time, six standard workflows were executing. The final observation below supplies their actual results independently of this code-quality and security assessment.

Aligned with: Credentials scrubbed from bare-cache remote before ref verification; safe.bareRepository=explicit honored; missing refs fail closed with no silent default-HEAD fallback. SSH-registered marketplace installs preserve the registered transport end-to-end with no silent HTTPS fallback. Named-ref resolution routed through Git, not the GitHub HTTPS commits API. SpecConformance ModeB gap addressed by genuine req-linked annotation under req-lk-003 -- proving repository identity and exact resolved commit persisted in lockfile -- over existing integration fixture, not by gate weakening or waiver. CONFORMANCE artifacts regenerated at the exact candidate head. SSH-key-only private marketplace installs work without an HTTPS token, matching the ergonomic expectation that a registered SSH transport should just work.

Panel summary

Persona B R N Takeaway
Test coverage expert 0 0 0 CI repair adds genuine req-lk-003 spec annotation over existing real-Git-fixture integration test; no bypass, no gate weakening, 8 mutation traps prove regression detection.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Recommendation

Current exact-head validation: 402 passed in 53.99s; conformance: 315 passed, 2 skipped in 92.39s; all seven current lint checks and the architecture boundary check passed. Canonical-owner evidence was re-derived and semantically verified for this exact head and integrated base. The eight prior mutation executions are retained with unchanged regression files; no new mutation run is claimed.

Four distinct specialist personas across two delta waves (auth, test-coverage, performance, supply-chain-security in the prior wave; test-coverage in the CI-repair wave) -- five returns total -- yield zero aggregate findings. The production diff is byte-identical to the prior ship_now assessment. Spec-conformance CI repair adds genuine req-lk-003 evidence without gate weakening. The code is ready to ship; all six technical workflows have now succeeded at this exact head. No follow-ups to track.

Final observation: Published/reviewed head d3d0679ae95ebbf3262f9f7c3d67ca588c470d50 has all six technical workflows passing. The earlier head's transient Windows runner-profile cleanup failure passed on its one targeted rerun; the replacement head's CI was observed independently. No production code or check policy was changed during mechanical integration. All four original review threads are resolved. Existing requested reviewers remain unchanged.

GitHub currently reports MERGEABLE, while a fresh local merge preview against main ee08bb59b9a7bce67fb4010e4af8652c4c53a7de is clean with no overlap in this PR's changed source paths. The locally tested incorporated base remains ee08bb59b9a7bce67fb4010e4af8652c4c53a7de; the later main preview is not a claim of full retesting on a later base. Landing remains the maintainer's decision. No merge was performed.


Full per-persona findings

Test coverage expert

No findings.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

Exercise marketplace registration, preflight, download, lockfile and deployment with real Git over a hermetic SSH fixture. Keep named SSH references out of the HTTPS commits API and verify a requested ref after bare clone fallback instead of silently accepting HEAD.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Verify qualified refs and reject absent refs using the canonical Git helper with explicit bare-repository selection. Scrub the remote before local validation can fail and cover both paths with real Git under safe.bareRepository=explicit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Address the Spec conformance Mode B failure with real req-lk-003 evidence rather than a waiver. SHA-pinned and named SSH marketplace installs now assert the exact persisted repository and resolved commit, using the existing native Git fixture.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Preserve the reviewed SSH marketplace patch and upstream behavior without rewriting contributor history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Faithfully retain reviewed SSH transport behavior and upstream manifestless marketplace certification.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit bd9fd4a into microsoft:main Oct 16, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants